<include file="../Public/agent.header.html" />
<link href="__PUBLIC__/Css/user.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/Js/user/common.js" charset="UTF-8"></script>

<div id="mainWrapper">

<div id="main">
 	<include file="../agent/Tpl/default/Public/user_left_nav_box.html" />
    
    <div id="right_box">
				<div class="item_top">
					<ul>
						<li class="top_bar top-bar-wide top_baron">{$userNavDict[MODULE_NAME][ACTION_NAME]}</li>
					</ul>
				</div>
				<div class="feedBox">
							<!-- 修改交易密码 -->
		          		<!-- 修改密码 -->
		          <div class="setItems">
		            <div class="setFold setUnfold" rel="base" >
		              <h2>修改密码</h2>
		            </div>
		            <div style="display: block;" class="setItemsInfo">
		            		<div class="dataR right">
			            		<div class="k_desc_div" style="margin: 0px;">
									<div class="k_icon k_bulb"></div>
									<strong>修改密码</strong>
									<div>
										在此可以修改你的登录密码！
									</div>
								</div>	
		            		</div>
							<div class="data">
							
							<php>if(!empty($user['sync_type'])){</php>
								<php>if('sina'==$user['sync_type']){</php>
									<img src="/Public/Images/global/sina24x24.png" align="absmiddle" title="新浪微博直接登录">
								<php>}</php>
								<php>if('douban'==$user['sync_type']){</php>
									<img src="/Public/Images/global/douban24x24.png" align="absmiddle" title="豆瓣直接登录">
								<php>}</php>
								&nbsp;直接登录&nbsp;&nbsp;<a href="javascript:register4Local( '{:U('Index://Public/registerLocal')}' );">转换为系统账号</a>
							<php>}else{</php>
							            <ul>
							                <li>
							                    <div class="left alR input_title areal">原始密码：</div>
							                    <div class="left area2">
							                      <div class="left mr5"><input id="oldpassword" type="password" class="input_text" /></div>
							                    </div>
							                </li>
							                <li>
							                    <div class="left alR input_title areal">新密码：</div>
							                    <div class="left area2">
							                      <div class="left mr5"><input id="password" type="password" class="input_text" /></div>
							                    </div>
							                </li>
							                <li>
							                    <div class="left alR input_title areal">确认密码：</div>
							                    <div class="left area2">
							                      <div class="left mr5"><input id="repassword" type="password" class="input_text" /></div>
							                    </div>
							                </li>
							                <li>
							                	<div class="left alR areal">&nbsp;</div>
							                	<div class="left area2">
							                		<input type="submit" class="btn_r" value="保存修改" 
							                				callback="modifyPassword()" onclick="ui.confirm(this,'确认修改登录密码么？');"
							                				id="btn_modify_pwd"/>
							                	</div>
							                </li>
							           </ul>
							<php>}</php>
							</div>
							      
			        	</div>
			        </div><!-- 修改密码 end  -->
		
				
		        <div class="c"></div>
		        </div>
		      </div>
  <!-- 右侧内容 end  -->
  <div class="c"></div>
</div>
</div>
<include file="../Public/footer.html" />

<script>
	//$(function(){
		var hs = document.location.hash;
		//var _basemodel = 'mobile';
		changeModel( hs.replace('#','') ,_basemodel);
		$('.setFold').click(function(){
			if( $(this).attr('class')=='setFold' ){
				changeModel( $(this).attr('rel'),_basemodel );
			}else{
				$(this).removeClass('setUnfold');
				$(this).next('.setItemsInfo').hide();
			}
			//location.href='#'+$(this).attr('rel');
		});
		
	
	//});
	
	

	function modifyPassword() {
		$('#btn_modify_pwd').attr('disabled','true');
		var oldpassword = $('#oldpassword').val();
		var repassword = $('#repassword').val();
		var password = $('#password').val();
		k_ajaxRequest("{:U('agent://Account/doModifyPassword')}",
										{oldpassword:oldpassword,password:password,repassword:repassword},
										function(){ $('#btn_modify_pwd').removeAttr('disabled'); },
										function(){ $('#btn_modify_pwd').removeAttr('disabled'); }
									);
	}

</script>